package org.example.software.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.software.entity.Tools;

import java.util.List;

@Mapper
public interface ToolsMapper extends BaseMapper<Tools> {
    @Select("SELECT * FROM tools WHERE id=#{id}")
    List<Tools> getToolsById(int id);

    @Select("SELECT * FROM tools WHERE manufacturer_name LIKE CONCAT('%', #{manufacturer_name}, '%')")
    List<Tools> getToolsByName(String manufacturer_name);

    @Select("SELECT * FROM tools WHERE LIKE CONCAT('%', #{tool_name}, '%')")
    List<Tools> getToolsByToolName(String tool_name);

    //@Select("SELECT * FROM book WHERE LIKE CONCAT('%', #{publisher}, '%')")
    //List<Tools> getToolsByPublisher(String publisher);
}
